# Contributor: Andrew Panteleyev <insonifi@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gst-rtsp-server
pkgver=1.22.8
pkgrel=0
pkgdesc="GStreamer RTSP server"
url="https://gstreamer.freedesktop.org"
arch="all"
license="LGPL-2.0-or-later"
depends_dev="gst-plugins-base-dev"
makedepends="
	$depends_dev
	gobject-introspection-dev
	gst-plugins-bad-dev
	gstreamer-dev
	meson
	"
checkdepends="gst-plugins-good"
subpackages="$pkgname-dev"
source="https://gstreamer.freedesktop.org/src/gst-rtsp-server/gst-rtsp-server-$pkgver.tar.xz"
options="!check" # tests pass locally but not in ci

build() {
	CFLAGS="$CFLAGS -O2" \
	CXXFLAGS="$CXXFLAGS -O2" \
	CPPFLAGS="$CPPFLAGS -O2" \
	abuild-meson \
		-Db_lto=true \
		-Dpackage-origin="https://alpinelinux.org" \
		-Dpackage-name="GStreamer RTSP server (Alpine Linux)" \
		-Dtests="$(want_check && echo enabled || echo disabled)" \
		. output
	meson compile -C output
}

check() {
	meson test --print-errorlogs --no-rebuild -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
95186e60b18ed4ac953d95b3bb648cf07b13b9e6562cf2cf6722710ed6299b4afd40f34e4f675b1760c9d557e45d8f324ddccf09b007a77f0c44e7860d4d7316  gst-rtsp-server-1.22.8.tar.xz
"
